package com.zyy.facade;

/**
 * @Description: 类描述
 * @Author: zyy
 * @Date: 2023/08/02 23:40
 */
public class SmartAppliancesFacade {
    private Light light;
    private AirCondition airCondition;
    private TV tv;

    public SmartAppliancesFacade() {
        light = new Light();
        airCondition = new AirCondition();
        tv = new TV();
    }

    private void on() {
        light.on();
        airCondition.on();
        tv.on();
    }

    private void off() {
        light.off();
        airCondition.off();
        tv.off();
    }

    public void say(String message) {
        if (message.contains("打开")) {
            on();
        } else if (message.contains("关闭")) {
            off();
        } else {
            System.out.println("暂时不支持该指令");
        }
    }
}
